Birthday Dictionaries 生日字典 <<
Previous Next >> Discussion topics 討論主題
Exercise 33 and Solution 練習33 和解決方案
This exercise is Part 1 of 4 of the birthday data exercise series. The other exercises are: Part 2, Part 3, and Part 4.
此練習是生日數據練習系列4的第1部分。其他練習是:第2部分,第3部分和第4部分。
在本練習中,我們將跟踪朋友的生日,並能夠根據他們的姓名查找該信息。在您的文件中創建一個名稱和生日字典。當您運行程序時,應要求用戶輸入名稱,並將該人的生日返回給他們。交互應如下所示:
For this exercise, we will keep track of when our friend’s birthdays are, and be able to find that information based on their name. Create a dictionary (in your file) of names and birthdays. When you run your program it should ask the user to enter a name, and return the birthday of that person back to them. The interaction should look something like this:
>>> Welcome to the birthday dictionary. We know the birthdays of:
Albert Einstein
Benjamin Franklin
Ada Lovelace
>>> Who's birthday do you want to look up?
Benjamin Franklin
>>> Benjamin Franklin's birthday is 01/17/1706.
Happy coding! 祝您編碼愉快!
Birthday Dictionaries 生日字典 <<
Previous Next >> Discussion topics 討論主題